<% if flash[:error] %><div><%= flash[:error] %></div><% end %>

<div class="post2-container">
  <% form_for :advertisment, @advertisment, :url => {:controller => "advertisments",  :action => "post_free_ad" ,:step=>3} , :html => { :multipart => true } do |form| %>
      <%= hidden_field_tag(:advertisment_record_id,@advertisment.id) -%>
    <div class="post-left-column">
        <div id="verification-box" class="verification-box" <% if @user.status == 1 -%> style="display:none;" <%end -%>>
            <div class="verification-text">
                 A verification e-mail has been sent to your e-mail ID. Click on the link provided to verify your ID.
                 or, A verification code has been sent to you through SMS. Enter the code below and click Verify.
            </div>
            <div class="enter-verify-code">
                <input type="text" class="enter-code" id="verification_code" value="Enter code" size="10" maxlength="6"/>&nbsp;&nbsp;
                <%= link_to_remote image_tag('verify-code.jpg', :alt=>"verify", :width=>"50px", :height=>"20px", :border=>"0px"),
                  :url => {:controller=>"post", :action =>"update_status",:id => @user},:with => "'verification_code=' + $('verification_code').value",
                   :update => "verification_box" -%>

                <div class="code-example">Code E.g. 67194</div>
           </div>
        </div>

        <div class="post-steps-header">
           <%=image_tag 'post-step-2.jpg', :alt=>"verify", :width=>"665px", :height=>"137px", :border=>"0px" -%>
        </div>
        
        <div class="post2-inner">
        	<div class="step-2-text">
            STEP 2. Fill in the details of the Ad to get better responses.
            </div>

            <div class="post-ad-title">
                <div>  Title       :</div>
                <div> <%= form.text_field  :title ,:size => 40 , :onfocus=>"show_sample_text('title');" , :onblur=>"hide_sample_text('title');" , :onkeyup=>"document.getElementById('count').innerHTML = this.value.length;"%>
                   <span id="title"class="sampletext"><%=  $sample_text["title"] %></span>
                </div>
              <div class="post-ad-title-max">min 20 and max 100 charachters(<span id="count">0</span>/100)</div>
            </div>


            <div class="post-ad-details">
              <div>  Description : </div>
              <div> <%= form.text_area  :description , :size => "50x7"  , :onfocus=>"show_sample_text('description');" , :onblur=>"hide_sample_text('description');",:onkeyup=>"document.getElementById('count2').innerHTML = this.value.length;" %>
                <span id="description"class="sampletext"><%=  $sample_text["description"] %></span>
              </div>
              <div class="post-ad-details-max">min 40 and max 1000 charachters(<span id="count2">0</span>/1000)</div>
            </div>

            <div class="room-details">
              <div>Location :</div>
              <div> <%= form.text_field  :location , :size => 20 , :onfocus=>"show_sample_text('location');" , :onblur=>"hide_sample_text('location');"%>
                <span id="location"class="sampletext"><%=  $sample_text["location"] %></span>
              </div>
            </div>
            <div style="clear:both;margin:10px 30px 10px 10px">
              <%unless @sub_category.advertisment_form_field.nil? -%>
                <%@sub_category.advertisment_form_field.each do |form_field| -%>
                  <div>
                    <%=form_field[:label]-%> :
                  </div>
                  <div style="clear:both;">
                    <%=send(form_field[:input_type][0], "advertisment_attributes[#{form_field[:input_type][1]}]", form_field[:input_type][2])-%>
                  </div>
                <br />
                <%end -%>
              <%end -%>
            </div>

            <div class="upload-photos">
              <div>Upload Photos</div>
              <div class="upload-photos-input">
                 <%=file_field(:upload,:file1) -%>
                 <%=file_field(:upload,:file2) -%>
                 <%=file_field(:upload,:file3) -%>
                 <%=file_field(:upload,:file4) -%>
              </div>
            </div>

        	<div class="proceed-button2">
              <%=hidden_field_tag(:university_id,@university.id) -%>
              <%=hidden_field_tag(:category_id,@sub_category.category_id) -%>
              <%=hidden_field_tag(:sub_category_id,@sub_category.id) -%>



               <%=image_submit_tag "proceed.jpg", :border=>"0", :width=>"68px", :height=>"24px"%>
            </div>

            <div class="verification-message2">
              <%=image_tag 'verification-message2.jpg', :width=>"190px", :height=>"64px", :border=>"0px" -%>
            </div>
        </div>
    </div>
    <div class="post-right-column">
      <div class="post-tips">
         <%=image_tag 'post-tips.jpg', :border=>"0px" -%>
      </div>
    </div>
    <%end -%>
</div>